/**
 * 
 */
package com.eventos.custom_view;

import android.content.Context;
import android.util.AttributeSet;
import android.view.LayoutInflater;
import android.widget.ImageView;
import android.widget.RelativeLayout;

import com.ofek.eventos.R;

/**
 * @author Ofek
 *
 */
public class EventStatus extends RelativeLayout {

	private ImageView image;

	public EventStatus(final Context context, final AttributeSet attrs, final int defStyle) {
		super(context, attrs, defStyle);
		init();
	}

	/**
	 * 
	 */
	private void init() {
		final LayoutInflater inflater = (LayoutInflater) getContext()
				.getSystemService(Context.LAYOUT_INFLATER_SERVICE);
		inflater.inflate(R.layout.view_compound_status, this, true);
		image = (ImageView)findViewById(R.id.image);
	}

	public EventStatus(final Context context, final AttributeSet attrs) {
		super(context, attrs);
		init();
	}

	public EventStatus(final Context context) {
		super(context);
		init();
	}

	/**
	 * @param confirmed
	 */
	public void setStatus(final boolean confirmed) {
		image.setImageResource(confirmed ? R.drawable.confirmed : R.drawable.wait);
	}

}
